# error code
ACL_ERROR_NONE = 0

# rule for mem
ACL_MEM_MALLOC_HUGE_FIRST = 0
ACL_MEM_MALLOC_HUGE_ONLY = 1
ACL_MEM_MALLOC_NORMAL_ONLY = 2

# rule for memory copy
ACL_MEMCPY_HOST_TO_HOST = 0
ACL_MEMCPY_HOST_TO_DEVICE = 1
ACL_MEMCPY_DEVICE_TO_HOST = 2
ACL_MEMCPY_DEVICE_TO_DEVICE = 3

# NUMPY data type
NPY_BOOL = 0
NPY_BYTE = 1
NPY_UBYTE = 2
NPY_SHORT = 3
NPY_USHORT = 4
NPY_INT = 5
NPY_UINT = 6
NPY_LONG = 7
NPY_ULONG = 8
NPY_LONGLONG = 9
NPY_ULONGLONG = 10

# data format
ACL_FORMAT_UNDEFINED = -1
ACL_FORMAT_NCHW = 0
ACL_FORMAT_NHWC = 1
ACL_FORMAT_ND = 2
ACL_FORMAT_NC1HWC0 = 3
ACL_FORMAT_FRACTAL_Z = 4

# data type
ACL_DT_UNDEFINED = -1
ACL_FLOAT = 0
ACL_FLOAT16 = 1
ACL_INT8 = 2
ACL_INT32 = 3
ACL_UINT8 = 4
ACL_INT16 = 6
ACL_UINT16 = 7
ACL_UINT32 = 8
ACL_INT64 = 9
ACL_UINT64 = 10
ACL_DOUBLE = 11
ACL_BOOL = 12

# video encoding protocol
H265_MAIN_LEVEL = 0
H264_BASELINE_LEVEL = 1
H264_MAIN_LEVEL = 2
H264_HIGH_LEVEL = 3

# dvpp pixel format
PIXEL_FORMAT_YUV_400 = 0  # YUV400 8bit
PIXEL_FORMAT_YUV_SEMIPLANAR_420 = 1  # YUV420SP NV12 8bit
PIXEL_FORMAT_YVU_SEMIPLANAR_420 = 2  # YUV420SP NV21 8bit
PIXEL_FORMAT_YUV_SEMIPLANAR_422 = 3  # YUV422SP NV12 8bit
PIXEL_FORMAT_YVU_SEMIPLANAR_422 = 4  # YUV422SP NV21 8bit
PIXEL_FORMAT_YUV_SEMIPLANAR_444 = 5  # YUV444SP NV12 8bit
PIXEL_FORMAT_YVU_SEMIPLANAR_444 = 6  # YUV444SP NV21 8bit
PIXEL_FORMAT_YUYV_PACKED_422 = 7  # YUV422P YUYV 8bit
PIXEL_FORMAT_UYVY_PACKED_422 = 8  # YUV422P UYVY 8bit
PIXEL_FORMAT_YVYU_PACKED_422 = 9  # YUV422P YVYU 8bit
PIXEL_FORMAT_VYUY_PACKED_422 = 10  # YUV422P VYUY 8bit
PIXEL_FORMAT_YUV_PACKED_444 = 11  # YUV444P 8bit
PIXEL_FORMAT_RGB_888 = 12  # RGB888
PIXEL_FORMAT_BGR_888 = 13  # BGR888
PIXEL_FORMAT_ARGB_8888 = 14  # ARGB8888
PIXEL_FORMAT_ABGR_8888 = 15  # ABGR8888
PIXEL_FORMAT_RGBA_8888 = 16  # RGBA8888
PIXEL_FORMAT_BGRA_8888 = 17  # BGRA8888
PIXEL_FORMAT_YUV_SEMI_PLANNER_420_10BIT = 18  # YUV420SP 10bit
PIXEL_FORMAT_YVU_SEMI_PLANNER_420_10BIT = 19  # YVU420sp 10bit
PIXEL_FORMAT_YVU_PLANAR_420 = 20  # YUV420P 8bit
PIXEL_FORMAT_YVU_PLANAR_422 = 21
PIXEL_FORMAT_YVU_PLANAR_444 = 22
PIXEL_FORMAT_RGB_444 = 23
PIXEL_FORMAT_BGR_444 = 24
PIXEL_FORMAT_ARGB_4444 = 25
PIXEL_FORMAT_ABGR_4444 = 26
PIXEL_FORMAT_RGBA_4444 = 27
PIXEL_FORMAT_BGRA_4444 = 28
PIXEL_FORMAT_RGB_555 = 29
PIXEL_FORMAT_BGR_555 = 30
PIXEL_FORMAT_RGB_565 = 31
PIXEL_FORMAT_BGR_565 = 32
PIXEL_FORMAT_ARGB_1555 = 33
PIXEL_FORMAT_ABGR_1555 = 34
PIXEL_FORMAT_RGBA_1555 = 35
PIXEL_FORMAT_BGRA_1555 = 36
PIXEL_FORMAT_ARGB_8565 = 37
PIXEL_FORMAT_ABGR_8565 = 38
PIXEL_FORMAT_RGBA_8565 = 39
PIXEL_FORMAT_BGRA_8565 = 40
PIXEL_FORMAT_RGB_BAYER_8BPP = 50
PIXEL_FORMAT_RGB_BAYER_10BPP = 51
PIXEL_FORMAT_RGB_BAYER_12BPP = 52
PIXEL_FORMAT_RGB_BAYER_14BPP = 53
PIXEL_FORMAT_RGB_BAYER_16BPP = 54
PIXEL_FORMAT_BGR_888_PLANAR = 70
PIXEL_FORMAT_HSV_888_PACKAGE = 71
PIXEL_FORMAT_HSV_888_PLANAR = 72
PIXEL_FORMAT_LAB_888_PACKAGE = 73
PIXEL_FORMAT_LAB_888_PLANAR = 74
PIXEL_FORMAT_S8C1 = 75
PIXEL_FORMAT_S8C2_PACKAGE = 76
PIXEL_FORMAT_S8C2_PLANAR = 77
PIXEL_FORMAT_S16C1 = 78
PIXEL_FORMAT_U8C1 = 79
PIXEL_FORMAT_U16C1 = 80
PIXEL_FORMAT_S32C1 = 81
PIXEL_FORMAT_U32C1 = 82
PIXEL_FORMAT_U64C1 = 83
PIXEL_FORMAT_S64C1 = 84
PIXEL_FORMAT_BUTT = 1003
PIXEL_FORMAT_UNKNOWN = 10000

# images format
IMG_EXT = ['.jpg', '.JPG', '.png', '.PNG', '.bmp', '.BMP', '.jpeg', '.JPEG']

# thread
TASK_DONE = 0
TASK_START = 1

# memory
STATIC_BATCH_RESOLUTION = 0
DYNAMIC_BATCH = 1
DYNAMIC_RESOLUTION = 2

APPEND = 1
REMOVE = 2

DVPP = 1
DEVICE = 2
HOST = 3

#ascend dvpp
FUNC_LIST = ['jpegd', 'vdec', 'venc', 'crop', 'crop_and_paste', 'resize', 'device_in','device_out', 'host']
STATIC_MODE = 0
DYNAMIC_BATCH = 1
DYNAMIC_RESOLUTION = 2

#resource manager
SET_DEVICE = 1
RESET_DEVICE = 2
RUN_MODE = 3

#log
DEBUG = 0
INFO = 1
WARNING = 2
ERROR = 3

TOPLEFTX=0
TOPLEFTY=1
BOTTOMRIGHTX=2
BOTTOMRIGHTY=3
SCORE=4
LABEL=5

yolov3Label = ["person", "bicycle", "car", "motorbike",
    "aeroplane","bus", "train", "truck", "boat",
    "traffic light", "fire hydrant", "stop sign", "parking meter",
    "bench", "bird", "cat", "dog", "horse",
    "sheep", "cow", "elephant", "bear", "zebra",
    "giraffe", "backpack", "umbrella", "handbag","tie",
    "suitcase", "frisbee", "skis", "snowboard", "sports ball",
    "kite", "baseball bat", "baseball glove", "skateboard", "surfboard",
    "tennis racket", "bottle", "wine glass", "cup",
    "fork", "knife", "spoon", "bowl", "banana",
    "apple", "sandwich", "orange", "broccoli", "carrot",
    "hot dog", "pizza", "donut", "cake", "chair",
    "sofa", "potted plant", "bed", "dining table", "toilet",
    "TV monitor", "laptop", "mouse", "remote", "keyboard",
    "cell phone", "microwave", "oven", "toaster", "sink",
    "refrigerator", "book", "clock", "vase","scissors",
    "teddy bear", "hair drier", "toothbrush"]
